// This is where project configuration and plugin options are located.
// Learn more: https://gridsome.org/docs/config

// Changes here require a server restart.
// To restart press CTRL + C in terminal and run `gridsome develop`

// const webpack = require('webpack')
// const GRIDSOME_STRAPI_URL = process.env.NODE_ENV === 'development' ? 'http://localhost:1337' : 'http://106.75.129.124:1337'

module.exports = {
  siteName: 'Gridsome',
  icon:{
    favicon: './assets/img/logo.svg'
  },
  // configureWebpack:{
  //   plugins: [
  //     new webpack.DefinePlugin({
  //       STRAPI_URL: JSON.stringify(STRAPI_URL)
  //     }),
  //   ]
  // },
  plugins: [
    {
      use: '@gridsome/source-strapi',
      options: {
        apiURL: process.env.GRIDSOME_STRAPI_URL,
        queryLimit: 1000, // Defaults to 100
        contentTypes: ['journal','project','category'],
        // typeName: 'Strapi'
        singleTypes: ['general'],
        // Possibility to login with a Strapi user,
        // when content types are not publicly available (optional).
        // loginData: {
        //   identifier: '',
        //   password: ''
        // }
      }
    }
  ],
  templates:{
    StrapiJournal: [
      {
        path: '/journal/:name',
        component: './src/templates/JournalPost.vue'
      }
    ],
    StrapiProject: [
      {
        path: '/project/:name',
        component: './src/templates/ProjectPost.vue'
      }
    ]
  }
}
